import { getStorage , setStorage } from '@/common/auth.js'
// 该状态是记录主页选中的是第几个
const state = {
    showIndex: getStorage('showIndex_key') || 0,
}
const mutations = {
    SET_SHOW_INDEX(state, index) {
        state.showIndex = index
        setStorage('showIndex_key',index)
    }
}
const actions = {
    setHomePageIndex({ commit }, param){
        commit('SET_SHOW_INDEX',param)
    }
}
export default {
    namespaced: true,
    state,
    mutations,
    actions
}

